package com.ruoyi.order.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.order.mapper.BlindBoxOrderMapper;
import com.ruoyi.order.domain.BlindBoxOrder;
import com.ruoyi.order.service.IBlindBoxOrderService;

/**
 * 盲盒订单Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-08-13
 */
@Service
public class BlindBoxOrderServiceImpl implements IBlindBoxOrderService 
{
    @Autowired
    private BlindBoxOrderMapper blindBoxOrderMapper;

    /**
     * 查询盲盒订单
     * 
     * @param id 盲盒订单主键
     * @return 盲盒订单
     */
    @Override
    public BlindBoxOrder selectBlindBoxOrderById(Long id)
    {
        return blindBoxOrderMapper.selectBlindBoxOrderById(id);
    }

    /**
     * 查询盲盒订单列表
     * 
     * @param blindBoxOrder 盲盒订单
     * @return 盲盒订单
     */
    @Override
    public List<BlindBoxOrder> selectBlindBoxOrderList(BlindBoxOrder blindBoxOrder)
    {
        return blindBoxOrderMapper.selectBlindBoxOrderList(blindBoxOrder);
    }

    /**
     * 新增盲盒订单
     * 
     * @param blindBoxOrder 盲盒订单
     * @return 结果
     */
    @Override
    public int insertBlindBoxOrder(BlindBoxOrder blindBoxOrder)
    {
        blindBoxOrder.setCreateTime(DateUtils.getNowDate());
        return blindBoxOrderMapper.insertBlindBoxOrder(blindBoxOrder);
    }

    /**
     * 修改盲盒订单
     * 
     * @param blindBoxOrder 盲盒订单
     * @return 结果
     */
    @Override
    public int updateBlindBoxOrder(BlindBoxOrder blindBoxOrder)
    {
        blindBoxOrder.setUpdateTime(DateUtils.getNowDate());
        return blindBoxOrderMapper.updateBlindBoxOrder(blindBoxOrder);
    }

    /**
     * 批量删除盲盒订单
     * 
     * @param ids 需要删除的盲盒订单主键
     * @return 结果
     */
    @Override
    public int deleteBlindBoxOrderByIds(Long[] ids)
    {
        return blindBoxOrderMapper.deleteBlindBoxOrderByIds(ids);
    }

    /**
     * 删除盲盒订单信息
     * 
     * @param id 盲盒订单主键
     * @return 结果
     */
    @Override
    public int deleteBlindBoxOrderById(Long id)
    {
        return blindBoxOrderMapper.deleteBlindBoxOrderById(id);
    }
}
